<form class="tableform" method='post' action='index.php?app=b2c&ctl=admin_order&act=dosplit' id="order-split-form">
	<input type="hidden" name="order_id" value="<{$order_id}>">
	<table cellpadding="0" cellspacing="0"  class="gridlist">
		<col style="width:10%"></col>
		<col style="width:15%"></col>
		<col style="width:10%"></col>
		<col style="width:15%"></col>
		<col style="width:5%"></col>
		<col style="width:5%"></col>
		<col style="width:10%"></col>
		<col style="width:10%"></col>
		<col style="width:10%"></col>
		<col style="width:10%"></col>
		<thead>
		<tr>
			<th><{t}>订单号<{/t}></th>
			<th><{t}>下单时间<{/t}></th>
			<th><{t}>货品编号<{/t}></th>
			<th><{t}>品牌<{/t}></th>
			<th><{t}>数量（包装）<{/t}></th>
			<th><{t}>每包装数量<{/t}></th>
			<th><{t}>销售单价<{/t}></th>
			<th><{t}>采购价<{/t}></th>
			<!--<th><{t}>已确认数量<{/t}></th>-->
			<th><{t}>确认数量<{/t}></th>
		</tr>
		</thead>
		<tbody>
		<{foreach from=$info item=item}>
		<tr>
			<td><{$item.childOrder_id}></td>
			<td><{$item.createtime|cdate}></td>
			<td><{$item.bn}></td>
			<td><{$item.brand_name}></td>
			<td><{$item.quantity}></td>
			<td><{$item.unit_num}></td>
			<td><{$item.s_price|cur}></td>
			<td><{$item.s_cost|cur}></td>
			<!--<td><{$item.has_confirm_num}></td>-->
			<td>
				<{if $item.state=='0'}>
				<!--<{t}>未确认<{/t}>-->
				<{input type="text" vtype="required&&number" name="confirm_num[{$item.obj_id}]" value=$item.quantity  q_data=$item.quantity width="30" onblur="check(this)"}>
				<{else $item.status=='1'}>
				<{t}>已确认<{/t}>
				<{/if}>
			</td>
		</tr>
		<{/foreach}>
		<{if !count($info) > 0}>
		<tr><td colspan=9><{t}>暂无确认库存数据<{/t}></td></tr>
		<{/if}>
		</tbody>
	</table>
	<{if count($info) > 0}>
	<div class="table-action">
		<{button label=$___b2c="确定"|t:'b2c' id="order-split-form-submit" class="order-action" type="submit"}>
	</div>
	<{/if}>
</div>
</form>

<script type="text/javascript">
(function(){
//	var _form = $('order-split-form');
//	var btn =$('order-split-form-submit');
//	btn.addEvent('click',function(){
//		_form.fireEvent('submit',{stop:$empty});
//	});
    var _form = $('order-split-form');
    var btn =$('order-split-form-submit');
    _form.store('target',{
    	onRequest:function() {
    	},
        onComplete:function(){

        },
        onSuccess:function(response){
            var hash_res_obj = JSON.decode(response);
            if (hash_res_obj.success != undefined && hash_res_obj.success != ""){
                //window.close();
				window.location.reload()
            }else{}
        }
    });
})();

function check(obj){
	var gc_confirm_num = obj.get('value');
	var quantity = obj.get('q_data');
	var reg=/(^[0-9]([0-9]*)$|^[1-9]$)/;

	if(reg.test(gc_confirm_num)){
		gc_confirm_num=parseInt(gc_confirm_num);
		if(gc_confirm_num>quantity){
			obj.value=quantity;
		}
	}else{
		obj.value=quantity;
	}
}
</script>